﻿using System;
using System.Linq.Expressions;

namespace RemoteCallsTest
{
    public interface IA
    {
        string M1(string arg1, int arg2);

        int M1(string arg1);

        void M1(int arg1);

        int M1<T>(string arg1);
    }

    public class AImpl: IA
    {
        private readonly CallExecutor callExecutor;

        public AImpl(CallExecutor callExecutor)
        {
            this.callExecutor = callExecutor;
        }

        public string M1(string arg1, int arg2)
        {
            return (string) callExecutor.Invoke(
                "M1",
                new object[] {typeof (string), typeof (int)},
                new object[] {arg1, arg2});
        }

        public int M1(string arg1)
        {
            throw new NotImplementedException();
        }

        public void M1(int arg1)
        {
            throw new NotImplementedException();
        }

        public int M1<T>(string arg1)
        {
            throw new NotImplementedException();
        }
    }

    public class CallExecutor
    {
        public object Invoke(string methodName, object[] argTypes, object[] args)
        {
            throw new NotImplementedException();
        }
    }
}
